rm(list = ls())

set.seed(1917)

# load relevant packages
source("00_pckgs.R")

# at times, the r session may crash for reasons unrelated to this code.
# in an initial run, the variable crash_check should be set equal to 'pre' so that mc data is generated.
# ideally, the entire code should then run through without interruption.
# in possible post-crash runs, the crash_check can be set to anything else than 'pre'.
crash_check <- "post"

# generate input data in initial pre-crash-run
if (crash_check == "pre"){
  source("01_mc_gen_data.R") 
}

# run models
for (i in 1:25){

  source("02_mc_run_models.R")
  
}

# extract results
source("03_mc_extract_results.R")

# visualize results
source("04_ex_viz.R")
source("04_mc_viz.R")
